/**
 * TManRankingMethod.java
 * ************************** 
 * @date May 5, 2011
 * @author Michele Tamburini
 * 
 * **************************
 */
package gossipServices.bootstraping.tman;

import gossipServices.basic.nodeDescriptors.NodeDescriptor;
import gossipServices.basic.view.PartialView;

/**
 * Description:
 * The ranking method sorts the nodes of a PartialView 
 * according to a particular criterion. 
 * Each class implementing this interface can follow its own 
 * criterion. 
 * The rank function takes as parameters a NodeDescriptor which is the baseNode,
 * and a PartialView, and returns a new PartialView sorted 
 * according to the "taste" of the given 'baseNode'. 
 * The target view size of the ranking method controls the size
 * of the graph and consequently affects the time of the protocol. 
 *
 */
public interface TManRankingMethod {

	/**
	 * It sorts a set of nodes taken as a PartialView in input
	 * according to the "taste" of a given 'baseNode'. 
	 * The sorting is established by the ranking method itself which
	 * can take advantage of different characteristics of the NodeDescriptor(s).
	 * @param baseNode : NodeDescriptor
	 * @param inputView : PartialView
	 * @return sortedView : PartialView
	 */
	public PartialView rank(NodeDescriptor baseNode, PartialView inputView);
	
	/**
	 * Returns the target view size: 'k'.
	 * @return k : int
	 */
	public int getTargetViewSize_K();
	
	/**
	 * Set the target view size 'k' to the input
	 * value as a parameter. 
	 * @param k : int
	 */
	public void setTargetViewSize_K(int k);
}
